

function onAddItem(moveitem, tileitem, position)
	if getThingFromPos({x = position.x, y = position.y, z = position.z, stackpos = 2}).uid == tileitem.uid and moveitem.itemid == 1947 then
		local tempTable, count = {}, 2
		table.insert(tempTable, moveitem.uid)
		table.insert(tempTable, tileitem.uid)
--		local pos = position
		
		for i = 3, 10 do
--			pos.stackpos = i
--			thing = getThingFromPos(pos)
			thing = getThingFromPos({x = position.x, y = position.y, z = position.z, stackpos = i})
			if count == 10 or thing.uid == nil or thing.uid == 0 or thing.itemid ~= 1947 then
				break
			end
			count = count +1
			table.insert(tempTable, thing.uid)
		end

		if count == 10 then
			for _, removeUid in pairs(tempTable) do
				doRemoveItem(removeUid)
			end
			doCreateItem(1955, {x = position.x, y = position.y, z = position.z})
			doSendMagicEffect(position, CONST_ME_POFF)
		end
		return true
	end
	return false
end